package com.flydb;
import org.flywaydb.core.Flyway;
import org.flywaydb.core.api.configuration.ClassicConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * @author:jml
 * @date: 2019/10/11 10:17
 * @description：
 */

@Configuration
public class FlyConfig {
	
	@Bean
	public ClassicConfiguration getFlywayConfig() {
		ClassicConfiguration classicConfiguration = new ClassicConfiguration();
		classicConfiguration.setDataSource(
				"jdbc:mysql://101.200.37.80:8004/LeadingDBTest?useUnicode=true&characterEncoding=utf-8",
				"leading", "leading2019");
		return classicConfiguration;
	}
	
	@Bean(initMethod = "migrate")
	public Flyway getFlyway(ClassicConfiguration classicConfiguration) {
		Flyway flyway = new Flyway(classicConfiguration);
		return flyway;
	}
	
	
}

